<template>
  <div>
    <h1>hello</h1>
    <p>Count: {{ $store.state.count }}</p>
    <p>Double Count: {{ doubleCount }}</p>
    <button @click="increment">Increment</button>
    <button @click="decrement">Decrement</button>
    <button @click="incrementAsync">Increment Async</button>
    <h1>hello~~</h1>
  </div>
</template>

<script>
/* eslint-disable */
export default {
  name: "vuex-demo",
  computed: {
    doubleCount() {
      return this.$store.getters.doubleCount;
    },
  },
  methods: {
    increment() {
      this.$store.commit("increment");
    },
    decrement() {
      this.$store.commit("decrement");
    },
    incrementAsync() {
      this.$store.dispatch("incrementAsync");
    },
  },
  mounted() {
    console.log("store", this.$store);
  },
};
</script>
